import * as config from '../common/config.js'
export function removeHtmlStyle(html = '') {
	const relStyle = /style\s*?=\s*?([‘"])[\s\S]*?\1/g //去除样式
	const relTag = /<.+?>/g //去除标签
	const relClass = /class\s*?=\s*?([‘"])[\s\S]*?\1/g // 清除类名
	let newHtml = ''
	if (html) {
		newHtml = html.replace(relStyle, '')
		newHtml = newHtml.replace(relTag, '')
		newHtml = newHtml.replaceAll('&nbsp;', '')
		newHtml = newHtml.replaceAll('&rdquo;', '')
	}
	return newHtml;
}

export function loadHttpImage(url = ''){
	const baseurl = config.baseUrl
	return `${baseurl}/url`
}